//
//  ZLSecondTableViewCell.m
//  TripTogether
//
//  Created by dllo on 15/12/29.
//  Copyright © 2015年 杨泓晔. All rights reserved.
//

#import "ZLSecondTableViewCell.h"

@implementation ZLSecondTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
       
        [self createSubView];
    }
    return self;
}

- (void)createSubView
{
    self.contentView.backgroundColor = [UIColor colorWithRed:0.98 green:0.97 blue:0.93 alpha:1];
    self.myLabel = [UILabel new];
    [self.contentView addSubview:self.myLabel];
    self.myLabel.font = [UIFont fontWithName:@"Rounded MT Bold" size:17.0f];
    [self.myLabel mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.left.equalTo(self.contentView.mas_left).offset(10);
        make.right.equalTo(self.contentView).offset(10);
        make.top.equalTo(self.contentView).offset(20);
        make.height.equalTo(@20);
    }];
    
    self.nameLabel = [UILabel new];
    [self.contentView addSubview:self.nameLabel];
    self.nameLabel.font = [UIFont systemFontOfSize:15.0f];
    self.nameLabel.lineBreakMode = NSLineBreakByWordWrapping;
    self.nameLabel.numberOfLines = 3;
    [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.left.equalTo(self.myLabel.mas_left);
        make.right.equalTo(self.contentView.mas_right).offset(-10);
        make.top.equalTo(self.myLabel.mas_bottom).offset(5);
        make.height.equalTo(@30);
    }];
    
}

- (void)setZlDetailImageM:(ZLDetailImageModel *)zlDetailImageM
{
    if (zlDetailImageM.descriptionss.length > 0) {
        self.myLabel.text = @"概况";
        self.num = 0;
        self.nameLabel.text = zlDetailImageM.descriptionss;
    }
    if (zlDetailImageM.address.length>0){
        self.myLabel.text = @"地址";
        self.nameLabel.text = zlDetailImageM.address;
    }
    if (zlDetailImageM.arrival_type.length > 0){
        self.myLabel.text = @"到达方式";
        self.nameLabel.text = zlDetailImageM.arrival_type;
    }
    if (zlDetailImageM.opening_time.length > 0){
        self.myLabel.text = @"开放时间";
        self.nameLabel.text = zlDetailImageM.opening_time;
    } if(zlDetailImageM.time_consuming.length > 0){
        self.myLabel.text = @"浏览耗时";
        self.nameLabel.text = zlDetailImageM.time_consuming;

    }
}


- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
